alter table jms_dwd.dwd_tab_barscan_centersend_base_hi set tblproperties ('external.table.purge'='true');
drop table if exists jms_dwd.dwd_tab_barscan_centersend_base_hi;
create external table jms_dwd.dwd_tab_barscan_centersend_base_hi(
record_id   string       comment "记录编号_ef"
,waybill_no   string       comment "运单编号_ef"
,list_code   string       comment "清单编号"
,subbill_code   string       comment "子单号"
,transfer_code   string       comment "订舱号、任务编号_ef"
,package_code   string       comment "所属包号_ef"
,scan_type   string       comment "扫描类型_ef"
,next_station   string       comment "下一站_ef"
,destination   string       comment "目的地点"
,scan_user   string       comment "扫描雇员_ef"
,scan_site   string       comment "扫描网点_ef"
,scan_time   timestamp    comment "扫描时间_ef"
,input_time   timestamp    comment "入库时间_ef"
,operate_date   timestamp    comment "操作日期_ef"
,send_deliver_user   string       comment "派件或收件员"
,send_customer   string       comment "寄件客户"
,send_site   string       comment "寄件网点_ef"
,dest_site   string       comment "目的网点"
,transfer_center   string       comment "中转中心"
,pcs   bigint       comment "件数"
,weight   decimal(10, 2)       comment "重量"
,good_type   string       comment "物品类别"
,transport_type   string       comment "运输方式_ef"
,shifts   string       comment "班次编号_ef(未发现有值)"
,transfer_deliver_fee   decimal(10, 2)       comment "中转或派件费"
,network_manage_fee   decimal(10, 2)       comment "网管费"
,other_fee   decimal(10, 2)       comment "其他费"
,check_flag   string       comment "核算标识"
,account_flag   bigint       comment "对账标识"
,receipt_flag   tinyint      comment "回单标识"
,return_flag   tinyint      comment "退件标识"
,elescale_flag   string       comment "电子秤标识"
,weight_flag   tinyint      comment "重量类型"
,writeback_flag   bigint       comment "回写标识"
,auto_type_flag   tinyint      comment "自动产生类型_ef"
,remark   string       comment "备注"
,station_num   string       comment "工位号_ef"
,modify_time   timestamp    comment "修改时间"
,mobile   string       comment "手机号码"
,pistol_id   string       comment "巴枪ID_ef"
,remark1   string       comment "备注1"
,flight_num   string       comment "航班号_ef"
,scan_site_code   string       comment "扫描网点编号_ef"
,upload_time   timestamp    comment "上传时间_ef"
,remark3   string       comment "备注3"
,scan_user_code   string       comment "扫描雇员编号_ef"
,send_deliver_usercode   string       comment " 收派员编号"
,next_station_code   string       comment "下一站编号_ef"
,source   string       comment "来源_ef"
,remark5   string       comment "备注5"
,remark6   decimal(10, 2)       comment "备注6"
,list_code2   string       comment "清单编号_ef"
,scan_site_id   bigint       comment "扫描网点ID_ef"
,next_station_id   bigint       comment "下一站id_ef"
,scan_user_id   bigint       comment "扫描雇员ID_ef"
,send_deliver_userid   bigint       comment "收派员ID"
,network_type tinyint comment "扫描网点类型，1.加盟商,2.转运中心,3.集散点,4.普通网点,5.代理区,6.总部,0.其他"
,site_agent_code string comment "所属代理区code"
,site_agent_name  string comment "所属代理区名称"
,site_franchisee_code  string comment "所属加盟商code "
,site_franchisee_name  string comment "所属加盟商名称"
,site_transcenter_code string comment "所属转运中心code"
,site_transcenter_name string comment "所属转运中心名称"
,next_network_type tinyint comment "下一站网点类型，1.加盟商,2.转运中心,3.集散点,4.普通网点,5.代理区,6.总部,0.其他"
,waybill_source string comment '运单来源：GB:国标单号,BS:百世单号,BSB:百世包号,JT:极兔单号,JTB:极兔包号,Other:其它'
)
COMMENT '操作平台-中心发件扫描表明细'
partitioned by (dt string)
stored as parquet
location "/dw/hive/jms_dwd.db/external/dwd_tab_barscan_centersend_base_hi"